package one.one.fifteen;

import java.util.Arrays;

public class Histogram {

	static int[] check(int[] a, int m) {
		int[] r = new int[m + 1];
		for (int i = 0; i < a.length; i++) {
			if (a[i] <= m) {
				r[a[i]]++;
			}
		}
		return r;
	}

	public static void main(String[] args) {
		int[] a = { 1, 2, 3,4,5,6,7 };
		int[] r=check(a, 19);
		
		System.out.println(Arrays.toString(r));

	}

}
